home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / g_man / cat3 / standard / texdef.z / texdef
Encoding:
Text File  |  2002-10-03  |  42.2 KB  |  727 lines

  1.  
  2.  
  3.  
  4. tttteeeexxxxddddeeeeffff((((3333GGGG))))                                                          tttteeeexxxxddddeeeeffff((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      tttteeeexxxxddddeeeeffff2222dddd - convert a 2-dimensional image into a texture
  10.      tttteeeexxxxddddeeeeffff3333dddd - convert a 3-dimensional image into a texture
  11.  
  12. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      vvvvooooiiiidddd tttteeeexxxxddddeeeeffff2222dddd((((lllloooonnnngggg iiiinnnnddddeeeexxxx,,,, lllloooonnnngggg nnnncccc,,,,
  14.                    lllloooonnnngggg wwwwiiiiddddtttthhhh,,,, lllloooonnnngggg hhhheeeeiiiigggghhhhtttt,,,,
  15.                    uuuunnnnssssiiiiggggnnnneeeedddd lllloooonnnngggg **** iiiimmmmaaaaggggeeee,,,, lllloooonnnngggg nnnnpppp,,,, ffffllllooooaaaatttt ****pppprrrrooooppppssss))))
  16.  
  17.      vvvvooooiiiidddd tttteeeexxxxddddeeeeffff3333dddd((((lllloooonnnngggg iiiinnnnddddeeeexxxx,,,, lllloooonnnngggg nnnncccc,,,,
  18.                    lllloooonnnngggg wwwwiiiiddddtttthhhh,,,, lllloooonnnngggg hhhheeeeiiiigggghhhhtttt,,,, lllloooonnnngggg ddddeeeepppptttthhhh,,,,
  19.                    uuuunnnnssssiiiiggggnnnneeeedddd lllloooonnnngggg **** iiiimmmmaaaaggggeeee,,,, lllloooonnnngggg nnnnpppp,,,, ffffllllooooaaaatttt ****pppprrrrooooppppssss))))
  20.  
  21. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  22.      _i_n_d_e_x    expects the name of the texture function being defined.  Index 0
  23.               is reserved as a null definition, and cannot be redefined.
  24.  
  25.      _n_c       expects the number of components per _i_m_a_g_e pixel.  1, 2, 3, and
  26.               4 component textures and 8-bit and 16-bit components are
  27.               supported.
  28.  
  29.      _w_i_d_t_h    expects the width of _i_m_a_g_e in pixels.
  30.  
  31.      _h_e_i_g_h_t   expects the height of _i_m_a_g_e in pixels.
  32.  
  33.      _d_e_p_t_h    expects the depth of _i_m_a_g_e in pixels.  (texdef3d only).
  34.  
  35.      _i_m_a_g_e    expects a long-word-aligned array containing the pixel data.
  36.               This texture image is loaded from left to right, bottom to top,
  37.               and back to front. The pixels are packed, but each row must
  38.               begin on a long word boundary. The end of each row must be
  39.               byte-padded if necessary.  The Graphics Library Programmer's
  40.               Guide shows how to load a texture array.
  41.  
  42.      _n_p       expects the number of symbols and floating point values in
  43.               _p_r_o_p_s, including the termination symbol TX_NULL.  If _n_p is zero,
  44.               it is ignored.  Operation over network connections is more
  45.               efficient when _n_p is correctly specified.
  46.  
  47.      _p_r_o_p_s    expects the array of floating point symbols and values that
  48.               control definition of the texture function.  _p_r_o_p_s must contain
  49.               a sequence of symbols, each followed by the appropriate number
  50.               of floating point values.  The last symbol must be TX_NULL.
  51.  
  52. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  53.      Texture coordinates, _s,_t,_r,_q may be specified at geometry vertices,
  54.      similarly to color, depth, and vertex normals.  The texture coordinates
  55.      are interpolated from the values specified at the vertices for each
  56.      screen pixel touched by the geometry.  A texture function maps the
  57.      texture coordinates _s,_t, or _s,_t,_r, corresponding to a screen pixel into
  58.      _n_c values, called texture function outputs, using an _i_m_a_g_e and a set of
  59.      properties. The texture function outputs may be translated into an equal
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. tttteeeexxxxddddeeeeffff((((3333GGGG))))                                                          tttteeeexxxxddddeeeeffff((((3333GGGG))))
  71.  
  72.  
  73.  
  74.      or greater number of texture function outputs with a texture look-up
  75.      table.  The texture function outputs are used by the texture environment
  76.      function to modify the screen pixel color.
  77.  
  78.      tttteeeexxxxddddeeeeffff2222dddd and tttteeeexxxxddddeeeeffff3333dddd define such a texture function and associate it
  79.      with _i_n_d_e_x.  tttteeeexxxxbbbbiiiinnnndddd selects which texture function definition to use.
  80.      The texture environment function is defined by tttteeeevvvvddddeeeeffff and selected by
  81.      tttteeeevvvvbbbbiiiinnnndddd. The texture lookup table is defined by ttttlllluuuuttttddddeeeeffff and selected by
  82.      ttttlllluuuuttttbbbbiiiinnnndddd. The texture coordinates are specified with the tttt family of
  83.      commands.
  84.  
  85.      Multiple image pixels may correspond to one screen pixel, and vice versa.
  86.      Sophisticated sample-filtering may be needed to generate texture function
  87.      outputs free of distracting visual artifacts. The filters may be
  88.      specified with the _p_r_o_p_s array.
  89.  
  90.      Regardless of the size of the image, it is mapped into _s,_t,_r-coordinates
  91.      such that its lower-left-back corner is (0,0,0), and its upper-right-
  92.      front corner is (1,1,1).  The way that _s,_t,_r map onto the image when they
  93.      are out of the range 0.0 through 1.0 is specified in the _p_r_o_p_s array.
  94.  
  95.      A useful texture function can be defined by simply passing an image and a
  96.      null _p_r_o_p_s array to tttteeeexxxxddddeeeeffff2222dddd and tttteeeexxxxddddeeeeffff3333dddd.  The options specified in the
  97.      _p_r_o_p_s array, however, give control over both texture mapping quality and
  98.      performance.  The following symbols are accepted in _p_r_o_p_s:
  99.  
  100.           TTTTXXXX____FFFFAAAASSSSTTTT____DDDDEEEEFFFFIIIINNNNEEEE specifies that the GL should not copy the passed
  101.           texture array to another buffer before loading the texture to
  102.           texture memory. This token is a synonym for the experimental tokens
  103.           TX_NOCOPY and TX_SUBTEXLOAD, and when used with fbsubtexload,
  104.           replaces the experimental TX_FRAMEBUFFER_SRC token. The TX_NOCOPY,
  105.           TX_SUBTEXLOAD and TX_FRAMEBUFFER_SRC tokens are obsolete.
  106.  
  107.           The advantages of using this token are that 1) texture definition
  108.           time is greatly reduced, sometimes by a factor of 10,000, and it
  109.           allows the use of subtexload and fbsubtexload to load new texture
  110.           data while the texture is bound. This allows dynamic textures. 2)
  111.           CPU memory use is also reduced since the user's array is used to
  112.           load texture memory directly, the GL does not need to copy the array
  113.           to a separate buffer for texture memory loading purposes.  3) The
  114.           TX_EXTERNAL_FORMAT, TX_PIXMODE token pair can be used to allow
  115.           automatic data conversions and scale and bias on the input texture
  116.           array when it is loaded to texture memory.
  117.  
  118.           The disadvantages are that 1) the cost of a texbind in the case that
  119.           texture that was not resident in texture memory and thus had to be
  120.           loaded is slightly greater, 2) No minification or magnification
  121.           filter which requires the generation of a MIPmap may be used. 3) The
  122.           token can only be used with textures that are size 2^M x 2^N where
  123.           M,N are integers.  4) The token is ignored by texdef3d.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. tttteeeexxxxddddeeeeffff((((3333GGGG))))                                                          tttteeeexxxxddddeeeeffff((((3333GGGG))))
  137.  
  138.  
  139.  
  140.           The passed array should not be overwritten or freed while the
  141.           texture is active because the array may be needed to reload texture
  142.           memory if the texture memory is invalidated by the need to load
  143.           other textures.
  144.  
  145.           The user may also pass a null array, and later fill all or part of
  146.           the texture memory allocated for the texture with the subtexload or
  147.           fbsubtexload commands.
  148.  
  149.           TTTTXXXX____MMMMIIIINNNNFFFFIIIILLLLTTTTEEEERRRR specifies the sample-filtering function used to
  150.           generate the texture function output when multiple image pixels
  151.           correspond to one pixel on the screen.  This token is followed by a
  152.           single symbol that specifies which minification filter to use. For
  153.           many Graphics Library implementations, texturing performance is
  154.           constrained by the number of samples used by the filter per texture
  155.           function output.  The classical 2D MIPmap filter needs to access
  156.           eight image pixels for each screen pixel.  Performance and quality
  157.           may be traded by limiting the number of samples used, and the
  158.           computations necessary to find the samples.
  159.  
  160.  
  161.             TTTTXXXX____PPPPOOOOIIIINNNNTTTT selects the value of the image pixel nearest to the _s,_t,_r
  162.             mapping onto the texture. (2d or 3d)
  163.             TTTTXXXX____BBBBIIIILLLLIIIINNNNEEEEAAAARRRR selects the weighted average of the values of the four
  164.             image pixels nearest to the _s,_t mapping onto the texture. (2d
  165.             only)
  166.             TTTTXXXX____BBBBIIIILLLLIIIINNNNEEEEAAAARRRR____LLLLEEEEQQQQUUUUAAAALLLL ((((oooorrrr TTTTXXXX____BBBBIIIILLLLIIIINNNNEEEEAAAARRRR____GGGGEEEEQQQQUUUUAAAALLLL)))) selects the four image
  167.             pixels nearest to the _s,_t mapping onto the texture.  The value of
  168.             the _r texture coordinate is compared with each image pixel.  If _r
  169.             is less than (or greater than) the image pixel, the result is
  170.             maximum image pixel value.  Otherwise it is 0.  The four
  171.             comparison results are bilinear blended.  This feature is useful
  172.             for real-time shadow computations.  (2d only)
  173.             TTTTXXXX____TTTTRRRRIIIILLLLIIIINNNNEEEEAAAARRRR selects the weighted average of the values of the
  174.             eight image pixels nearest to the _s,_t,_r mapping onto the texture.
  175.             (3d only)
  176.             TTTTXXXX____BBBBIIIICCCCUUUUBBBBIIIICCCC uses a smooth weighting of a 4x4 region of image pixels
  177.             nearest to the _s,_t mapping onto the texture. (2d only)
  178.             TTTTXXXX____MMMMIIIIPPPPMMMMAAAAPPPP____PPPPOOOOIIIINNNNTTTT chooses a prefiltered version of the image, based
  179.             on the number of image pixels that correspond to one screen pixel,
  180.             then selects the value of the pixel that is nearest to the _s,_t,_r
  181.             mapping onto that image. (2d or 3d)
  182.             TTTTXXXX____MMMMIIIIPPPPMMMMAAAAPPPP____LLLLIIIINNNNEEEEAAAARRRR chooses the two prefiltered versions of the image
  183.             that have the nearest image pixel to screen pixel size
  184.             correspondence, then selects the weighted average of the values of
  185.             the pixel in each of these images that is nearest the _s,_t,_r
  186.             mapping onto that image. (2d or 3d)
  187.             TTTTXXXX____MMMMIIIIPPPPMMMMAAAAPPPP____BBBBIIIILLLLIIIINNNNEEEEAAAARRRR chooses a prefiltered version of the image,
  188.             based on the number of image pixels that correspond to one screen
  189.             pixel, then selects the weighted average of the values of the four
  190.             pixels nearest to the _s,_t mapping onto that image. (2d only)
  191.             TTTTXXXX____MMMMIIIIPPPPMMMMAAAAPPPP____TTTTRRRRIIIILLLLIIIINNNNEEEEAAAARRRR chooses the two prefiltered versions of the
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. tttteeeexxxxddddeeeeffff((((3333GGGG))))                                                          tttteeeexxxxddddeeeeffff((((3333GGGG))))
  203.  
  204.  
  205.  
  206.             image that have the nearest image pixel to screen pixel size
  207.             correspondence, then selects the weighted average of the values of
  208.             the four pixels in each of these images that is nearest the _s,_t
  209.             mapping onto that image. The weighted averages from the two levels
  210.             are then themselves interpolated. (2d only)
  211.             TTTTXXXX____MMMMIIIIPPPPMMMMAAAAPPPP____QQQQUUUUAAAADDDDLLLLIIIINNNNEEEEAAAARRRR chooses the two prefiltered versions of the
  212.             image that have the nearest image pixel to screen pixel size
  213.             correspondence, then selects the weighted average of the values of
  214.             the eight pixels in each of these images that is nearest the _s,_t,_r
  215.             mapping onto that image. The weighted averages from the two levels
  216.             are then themselves interpolated. (3d only)
  217.  
  218.           The default minification filter is TX_MIPMAP_LINEAR or a filter of
  219.           equal performance, but better quality.  Prefiltered versions of the
  220.           image, when required by the minification filter, are computed
  221.           automatically by the Graphics Library. The TX_MIPMAP_FILTER_KERNEL
  222.           token, described below, specifies the 8x8 (2D) or 8x8x8 (3D) filter
  223.           kernel used by the Graphics Library to generate MIPmap levels.
  224.  
  225.           TTTTXXXX____MMMMAAAAGGGGFFFFIIIILLLLTTTTEEEERRRR or TTTTXXXX____MMMMAAAAGGGGFFFFIIIILLLLTTTTEEEERRRR____AAAALLLLPPPPHHHHAAAA or TTTTXXXX____MMMMAAAAGGGGFFFFIIIILLLLTTTTEEEERRRR____CCCCOOOOLLLLOOOORRRR specifies
  226.           the filter function used to generate the texture function output
  227.           when multiple screen pixels correspond to one image pixel.  It is
  228.           followed by a single symbol that specifies which magnification
  229.           filter to use.  The sample-filtering function can be specified
  230.           seperately for alpha and non-alpha texture function outputs with
  231.           TX_MAGFILTER_ALPHA and TX_MAGFILTER_COLOR.  One possible use of this
  232.           seperation of alpha and color magnification filters is for the case
  233.           where non-zero alpha defines a geometry-approximating template such
  234.           as a tree outline. The following token sequence TX_MAGFILTER_ALPHA,
  235.           TX_SHARPEN, TX_MAGFILTER_COLOR, TX_BILINEAR can be used to keep the
  236.           outline of the tree sharp without any color-shift side effects of
  237.           the sharpening magnification filter.  The magnification filter
  238.           symbols are:
  239.  
  240.  
  241.             TTTTXXXX____PPPPOOOOIIIINNNNTTTT selects the value of the image pixel nearest to the _s,_t,_r
  242.             mapping onto the texture. (2d or 3d)
  243.             TTTTXXXX____BBBBIIIILLLLIIIINNNNEEEEAAAARRRR selects the weighted average of the values of the four
  244.             image pixels nearest to the _s,_t mapping onto the texture. (2d
  245.             only)
  246.             TTTTXXXX____BBBBIIIILLLLIIIINNNNEEEEAAAARRRR____LLLLEEEEQQQQUUUUAAAALLLL ((((oooorrrr TTTTXXXX____BBBBIIIILLLLIIIINNNNEEEEAAAARRRR____GGGGEEEEQQQQUUUUAAAALLLL)))) must be used in
  247.             conjunction with the same TTTTXXXX____MMMMIIIINNNNFFFFIIIILLLLTTTTEEEERRRR.  (see TTTTXXXX____MMMMIIIINNNNFFFFIIIILLLLTTTTEEEERRRR above)
  248.             TTTTXXXX____TTTTRRRRIIIILLLLIIIINNNNEEEEAAAARRRR selects the weighted average of the values of the
  249.             eight image pixels nearest to the _s,_t,_r mapping onto the texture.
  250.             (3d only)
  251.             TTTTXXXX____BBBBIIIICCCCUUUUBBBBIIIICCCC computes a smooth weighted average of a 4x4 region of
  252.             image pixels nearest to the _s,_t mapping onto the texture. (2d
  253.             only)
  254.             TTTTXXXX____SSSSHHHHAAAARRRRPPPPEEEENNNN attempts to magnify the image without blurring. It may
  255.             only be used with mipmapped textures.  It computes the weighted
  256.             average of the values of the four pixels that are nearest the _s,_t
  257.             mapping onto that image for each of the top two levels of a
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. tttteeeexxxxddddeeeeffff((((3333GGGG))))                                                          tttteeeexxxxddddeeeeffff((((3333GGGG))))
  269.  
  270.  
  271.  
  272.             MIPmap. The two values are then extrapolated rather than
  273.             interpolated to get a final texel value.  A formulaic description
  274.             is
  275.  
  276.             final_texture_function =
  277.             (1 + sharpen_scale(LOD)) * bilinearly_interpolated_image_level_0  -
  278.             (    sharpen_scale(LOD)) * bilinearly_interpolated_image_level_1
  279.  
  280.             where LOD, or Level Of Detail, is a logarithmic function of the
  281.             ratio of screen pixel scale to image pixel scale.  LOD is 0 when
  282.             screen pixel scale equals image pixel scale, positive when screen
  283.             pixels are larger, and negative when screen pixels are smaller.
  284.             For magnification filters, LOD is negative.  The sharpen_scale
  285.             function is a positive valued function that may be specified with
  286.             the TX_CONTROL_POINT token, described below.  Because color
  287.             components may be pushed out of range, color shift may be evident
  288.             at large magnifications.
  289.             TTTTXXXX____AAAADDDDDDDD____DDDDEEEETTTTAAAAIIIILLLL may also be used to magnify the image while
  290.             maintaining fine detail. However, instead of using a filtered down
  291.             version of the image and the image, as with TX_SHARPEN, an
  292.             explicitly specified TX_DETAIL image is used. The TX_DETAIL image
  293.             is added to the image, scaled as a function of LOD at a rate that
  294.             can be specified by the user. A formulaic description of the
  295.             operation is
  296.  
  297.             final_texture_function =
  298.             bilinearly_interpolated_image  +
  299.             (bilin_interpolated_detail_image - max_pixel_val*0.5) *
  300.              detail_scale(LOD)
  301.  
  302.             The detail_scale(LOD) function is a positive valued function of
  303.             LOD.  The TX_CONTROL_POINT token, described below, can be used to
  304.             control the detail_scale(LOD) function.
  305.             TTTTXXXX____MMMMOOOODDDDUUUULLLLAAAATTTTEEEE____DDDDEEEETTTTAAAAIIIILLLL is similar to TX_ADD_DETAIL, but modulates the
  306.             image with an explicitly specified detail image, rather than
  307.             adding the detail image.  A formulaic description of the operation
  308.             is
  309.  
  310.             final_texture_function =
  311.             bilinearly_interpolated_image  +
  312.             (bilin_interpolated_detail_image - max_pixel_val*0.5) *
  313.              bilin_interpolated_image * detail_scale(LOD)
  314.  
  315.             The TX_CONTROL_POINT token, described below, can be used to
  316.             control the additive detail magnification function.
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. tttteeeexxxxddddeeeeffff((((3333GGGG))))                                                          tttteeeexxxxddddeeeeffff((((3333GGGG))))
  335.  
  336.  
  337.  
  338.           The default magnification filter is TTTTXXXX____BBBBIIIILLLLIIIINNNNEEEEAAAARRRR for texdef2d and
  339.           TTTTXXXX____TTTTRRRRIIIILLLLIIIINNNNEEEEAAAARRRR for texdef3d.
  340.  
  341.           TTTTXXXX____WWWWRRRRAAAAPPPP specifies how texture coordinates outside the range 0.0
  342.           through 1.0 are handled.
  343.  
  344.  
  345.             TTTTXXXX____RRRREEEEPPPPEEEEAAAATTTT uses the fractional parts of the texture coordinates.
  346.             TTTTXXXX____CCCCLLLLAAAAMMMMPPPP clamps the texture coordinates to the range 0.0 through
  347.             1.0.
  348.             TTTTXXXX____SSSSEEEELLLLEEEECCCCTTTT does not render pixels which fall outside the 0.0 to 1.0
  349.             texture coordinate range.
  350.  
  351.           The default texture coordinate handling is TTTTXXXX____RRRREEEEPPPPEEEEAAAATTTT....
  352.  
  353.           TTTTXXXX____WWWWRRRRAAAAPPPP____SSSS is like TX_WRAP, but it specifies behavior only for the _s
  354.           texture coordinate.
  355.  
  356.           TTTTXXXX____WWWWRRRRAAAAPPPP____TTTT is like TX_WRAP, but it specifies behavior only for the _t
  357.           texture coordinate.
  358.  
  359.           TTTTXXXX____WWWWRRRRAAAAPPPP____RRRR is like TX_WRAP, but it specifies behavior only for the _r
  360.           texture coordinate.
  361.  
  362.           TTTTXXXX____IIIINNNNTTTTEEEERRRRNNNNAAAALLLL____FFFFOOOORRRRMMMMAAAATTTT is a hint used to trade image quality for speed.
  363.           It affects the precision used internally in  texture function
  364.           computations in the Graphics Library. Because the performance of
  365.           texture function implementations is typically constrained by image
  366.           pixel accesses per screen pixel, the user can specify a smaller
  367.           internal image pixel size and often realize performance gain. Most
  368.           Graphics Library implementations will default to the smallest image
  369.           pixel size that still yields a performance increase.  When the
  370.           external format is larger than the internal format, the most
  371.           significant bits of the external format pixel are used. When the
  372.           external format is smaller than the internal format, the most
  373.           significant bits of the external format pixel are replicated in the
  374.           lower order bits of the internal format. Thus, three 8-bit external
  375.           format components with the hexadecimal values AB,FF,00 become the
  376.           three 12-bit internal format components with the hexadecimal values
  377.           ABA,FFF,000. It is an error to specify an internal format with a
  378.           different number of components than in the external format. For
  379.           example, an ABGR external texel should not be mapped to a TX_RGB_5
  380.           interal texel. There are two exceptions.  One component textures may
  381.           be used with TX_I_12A_4 and TX_IA_8 internal formats. For
  382.           completeness, TX_I_12 and TX_I_8 are defined as synonyms. Three
  383.           component textures may be used with TX_RGBA_8 internal formats. For
  384.           completeness, TX_RGB_8 is defined as a synonym for TX_RGBA_8.
  385.  
  386.  
  387.             TTTTXXXX____IIII____11112222AAAA____4444 specifies that a one or two component texture should be
  388.             computed with at least 12 bits for intensity and 4 bits for alpha.
  389.             Image pixel size: 16 bits.
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. tttteeeexxxxddddeeeeffff((((3333GGGG))))                                                          tttteeeexxxxddddeeeeffff((((3333GGGG))))
  401.  
  402.  
  403.  
  404.             TTTTXXXX____IIIIAAAA____8888 specifies that a two component texture should be computed
  405.             with at least 8 bits for intensity and 8 bits for alpha. Image
  406.             pixel size: 16 bits.
  407.             TTTTXXXX____RRRRGGGGBBBB____5555 specifies that a 3 component texture should be computed
  408.             with at least 5 bits for red and blue and at least 6 bits for
  409.             green. Image pixel size: 16 bits.
  410.             TTTTXXXX____RRRRGGGGBBBBAAAA____4444 specifies that a 4 component texture should be computed
  411.             with at least 4 bits per component. Image pixel size: 16 bits.
  412.             TTTTXXXX____IIIIAAAA____11112222 specifies that a 2 component texture should be computed
  413.             with at least 12 bits per component. Image pixel size: 24 bits;
  414.             may be rounded up to 32 bits.
  415.             TTTTXXXX____RRRRGGGGBBBBAAAA____8888 specifies that a 3 or 4 component texture should be
  416.             computed with at least 8 bits per component. Image pixel size: 32
  417.             bits.
  418.             TTTTXXXX____RRRRGGGGBBBBAAAA____11112222 specifies that a 4 component texture should be computed
  419.             with at least 12 bits per component. Image pixel size: 64 bits.
  420.             TTTTXXXX____RRRRGGGGBBBB____11112222 specifies that a 3 component texture should be computed
  421.             with at least 12 bits per component. Image pixel size: 64 bits.
  422.             TTTTXXXX____IIII____11116666 specifies that a 1 component texture is used as a shadow
  423.             map for real-time shadow computations. Image pixel size: 16 bits.
  424.  
  425.           TTTTXXXX____EEEEXXXXTTTTEEEERRRRNNNNAAAALLLL____FFFFOOOORRRRMMMMAAAATTTT tells the Graphic Library what size components
  426.           are being used in _i_m_a_g_e.
  427.  
  428.  
  429.             TTTTXXXX____PPPPAAAACCCCKKKK____8888 specifies that _i_m_a_g_e is composed of 8-bit components.
  430.             This is the default.
  431.             TTTTXXXX____PPPPAAAACCCCKKKK____11116666 specifies that _i_m_a_g_e is composed of 16-bit components.
  432.             TTTTXXXX____PPPPIIIIXXXXMMMMOOOODDDDEEEE specifies that the input pixel format and type
  433.             specifications and scale and bias values specified with pixmode
  434.             should be applied to the texture when it is loaded. This can only
  435.             be used with textures defined with the TX_FAST_DEFINE token.
  436.  
  437.           TTTTXXXX____MMMMIIIIPPPPMMMMAAAAPPPP____FFFFIIIILLLLTTTTEEEERRRR____KKKKEEEERRRRNNNNEEEELLLL specifies an 8x8x8 kernel to use as a
  438.           separable symmetric filter to generate MIPmap levels. Since it is
  439.           separable and symmetric, only one dimension needs to be specified.
  440.           The eight floating point values that follow the token specify the
  441.           token. The default used for some implementations which do not
  442.           correct for perspective distortion is
  443.           0.0, 0.0, 0.125, 0.375, 0.375, 0.125, 0.0, 0.0.
  444.           The default used for implementations which correct for perspective
  445.           distortion is
  446.           0.0, -0.03125, 0.05, 0.48125, 0.48125, 0.05, -0.03125, 0.0.
  447.           This filter blurs less.
  448.  
  449.           TTTTXXXX____CCCCOOOONNNNTTTTRRRROOOOLLLL____PPPPOOOOIIIINNNNTTTT is followed by a pair of floating point values, LOD
  450.           and scale.
  451.           TTTTXXXX____CCCCOOOONNNNTTTTRRRROOOOLLLL____CCCCLLLLAAAAMMMMPPPP is followed by one value.  The pairs of lod and
  452.           scale values specify the rate at which the TX_SHARPEN or
  453.           TX_ADD_DETAIL or TX_MODULATE_DETAIL magnification filter is applied,
  454.           as a function of LOD.  If no control points are specified, the
  455.           default control points are (0.,0.), (3.,3.), (4.,4.), (6.5, 6.5). If
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. tttteeeexxxxddddeeeeffff((((3333GGGG))))                                                          tttteeeexxxxddddeeeeffff((((3333GGGG))))
  467.  
  468.  
  469.  
  470.           any control points are specified, the default control points are not
  471.           used. Only the first 4 control points will have any effect.  The
  472.           TX_CONTROL_CLAMP token clamps the scale at a maximum value. Its
  473.           default is 6.5.
  474.  
  475.           TTTTXXXX____DDDDEEEETTTTAAAAIIIILLLL is followed by five values, J, K, M, N, and scramble. To
  476.           be used as a detail texture, that is, bound to the TX_TEXTURE_DETAIL
  477.           target rather than the familiar TX_TEXTURE_0 target, and used with a
  478.           texture that has TX_ADD_DETAIL or TX_MODULATE_DETAIL as a
  479.           magnification filter, this token must appear.  A detail texture is
  480.           interpreted as a J x K collection of detail subimages which modulate
  481.           or add to a M x N block of texture pixels. When a texture is used as
  482.           a detail texture, the properties MINFILTER, MAGFILTER,
  483.           MAGFILTER_COLOR, MAGFILTER_ALPHA, TX_WRAP, TX_WRAP_S, TX_WRAP_T,
  484.           TX_WRAP_R, TX_MIPMAP_FILTER_KERNEL, TX_CONTROL_POINT,
  485.           TX_CONTROL_CLAMP, and TX_TILE have no effect.
  486.  
  487.           TTTTXXXX____TTTTIIIILLLLEEEE specifies a subregion of an image to be turned into a
  488.           texture.  It is followed by four floating point coordinates that
  489.           specify the _x and _y coordinates of the lower-left corner of the
  490.           subregion, then the _x and _y coordinates of the upper-right corner of
  491.           the subregion.  The original texture image continues to be addressed
  492.           in the range 0,0 through 1,1.  However, the subregion occupies only
  493.           a fraction of this space, and pixels that map outside the subregion
  494.           are not drawn.
  495.  
  496.           If the image (or the specified subregion) is larger than can be
  497.           handled by the hardware, it is reduced to the maximum supported size
  498.           automatically (with no indication other than the resulting visual
  499.           quality).  Because subregions are specified independently, they
  500.           should all be the same size (otherwise some may be reduced and
  501.           others not).
  502.  
  503.           TX_TILE supports mapping of high-resolution images with multiple
  504.           rendering passes.  By splitting the texture into multiple pieces,
  505.           each piece can be rendered at the maximum supported texture
  506.           resolution.  For example, to render a scene with 2x texture
  507.           resolution, tttteeeexxxxddddeeeeffff2222dddd is called four times.  Each call includes the
  508.           entire image, but specifies a different subregion of that image to
  509.           be converted into a texture.  To divide the image both horizontally
  510.           and vertically into quadrants the subregions should be (0,0 .5,.5),
  511.           (.5,0 1,.5), (0,.5 .5,1), and (.5,.5 1,1).  The scene is then drawn
  512.           four times, each time calling tttteeeexxxxbbbbiiiinnnndddd with the texture id of one of
  513.           the four quadrants.  In each pass, only the pixels whose texture
  514.           coordinates map within that quadrant are drawn.  Pixels outside of
  515.           this quadrant are effectively clipped.
  516.  
  517.           TTTTXXXX____BBBBIIIICCCCUUUUBBBBIIIICCCC____FFFFIIIILLLLTTTTEEEERRRR is followed by two values, B and C, that specify
  518.           the blurring and ringing quality of the bicubic texture filter used
  519.           for TX_MINFILTER and/or TX_MAGFILTER.  The detailed usage of these
  520.           values is described in Don Mitchell's paper, ``Reconstruction
  521.           Filters in Computer Graphics'', on SIGGRAPH'88.  The same B and C
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. tttteeeexxxxddddeeeeffff((((3333GGGG))))                                                          tttteeeexxxxddddeeeeffff((((3333GGGG))))
  533.  
  534.  
  535.  
  536.           will be applied to both s and t.  If B and C are not specified when
  537.           bicubic texture mapping is performed (TX_BICUBIC is used for
  538.           TX_MINFILTER and/or TX_MAGFILTER), a default bicubic texture filter
  539.           will be used.
  540.  
  541. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  542.      afunction, scrsubdivide, t, tevbind, tevdef, texbind, texgen, tlutdef,
  543.      tlutbind
  544.  
  545. NNNNOOOOTTTTEEEESSSS
  546.      tttteeeexxxxddddeeeeffff2222dddd is immediate mode only.  IRIS-4D G, GT, and GTX models, and the
  547.      Personal Iris, do not support texture mapping.  tttteeeexxxxddddeeeeffff2222dddd is ignored by
  548.      these machines.  tttteeeexxxxddddeeeeffff3333dddd only accepts images of size 2^j x 2^k x 2^l
  549.      where j,k,l are non-negative integers. Non-power of two images are not
  550.      accepted.  This is different than texdef2d, but consistent with OpenGL.
  551.      The Iris Indy, Indigo Entry, and XL support texture mapping except for
  552.      lines.  Use ggggeeeettttggggddddeeeesssscccc to determine whether texture mapping is supported.
  553.  
  554.      TTTTXXXX____MMMMIIIIPPPPMMMMAAAAPPPP____TTTTRRRRIIIILLLLIIIINNNNEEEEAAAARRRR is not supported on the VGX model.
  555.  
  556.      It is acceptable to define a 4-component texture function on an IRIS-4D
  557.      VGX, or VGXT, system that does not have alpha bitplanes.  However, this
  558.      definition will be treated as a 3-component definition by tttteeeevvvvddddeeeeffff.  Use
  559.      ggggeeeettttggggddddeeeesssscccc((((GGGGDDDD____BBBBIIIITTTTSSSS____NNNNOOOORRRRMMMM____AAAALLLLPPPPHHHHAAAA)))) to determine whether alpha bitplanes are
  560.      available.
  561.  
  562.      Points, lines, and characters, as well as polygons, are texture mapped.
  563.      Filter selection and wrap modes are applicable to lines.  Points are
  564.      filtered by the magnification filter, assuming a 1-to-1 correspondence
  565.      between texture pixel and screen pixel size.  Characters use the same
  566.      magnification filter, but are mapped assuming that both _s and _t are zero.
  567.  
  568.      IRIS screen pixels have integer coordinates at their centers.  Texture
  569.      images, however, have integer coordinates (0 and 1) at their exact edges,
  570.      not at the centers of pixels on their edges.
  571.  
  572.      On IRIS-4D VGXT models tiling large images will improve texture quality
  573.      only when the individual tiles measure no more than 1/4 the original
  574.      image size in either dimension.
  575.  
  576.      On IRIS-4D RealityEngine models the only MIPmap filter used is
  577.      TX_MIPMAP_TRILINEAR for 2D and TX_MIPMAP_QUADLINEAR for 3d. All the other
  578.      forms of MIPmap filters will default to these filters.
  579.  
  580.      The IRIS-4D G, GT, GTX, VGX, VGXT models, Personal Iris, Iris Indigo, and
  581.      Indy do not support tttteeeexxxxddddeeeeffff3333dddd, TX_BICUBIC, TX_MAGFILTER_COLOR,
  582.      TX_MAGFILTER_ALPHA, TX_SHARPEN, TX_ADD_DETAIL, TX_MODULATE_DETAIL,
  583.      TX_INTERNAL_FORMAT, TX_EXTERNAL_FORMAT, TX_MIPMAP_FILTER_KERNEL,
  584.      TX_CONTROL_POINT, TX_CONTROL_CLAMP, TX_DETAIL, TX_BILINEAR_LEQUAL,
  585.      TX_BILINEAR_GEQUAL, TX_BICUBIC_FILTER, or TX_FAST_DEFINE.
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. tttteeeexxxxddddeeeeffff((((3333GGGG))))                                                          tttteeeexxxxddddeeeeffff((((3333GGGG))))
  599.  
  600.  
  601.  
  602. BBBBUUUUGGGGSSSS
  603.      On IRIS-4D RealityEngine models:
  604.  
  605.           -  Discrepancies between the number of components in the external
  606.           format texel and the internal format texel are not detected.
  607.           Mismatched numbers of external and internal components will often
  608.           work anyway in the case of non- TX_FAST_DEFINE textures, but will
  609.           usually cause undesired results if TX_FAST_DEFINE is used.
  610.  
  611.           -  If a 1 component TX_FAST_DEFINE texture is used with a texture
  612.           look up table, (tlutdef,tlutbind), TX_INTERNAL_FORMAT, TX_IA_8
  613.           should be used rather than the default 1 component format TX_I_12A_4
  614.           to get the alpha lookup to perform correctly. The reason for this is
  615.           that the hardware considers the I_12A_4 format to be a two component
  616.           format and A is used to lookup A in the tlut, rather than using I to
  617.           lookup A. The top 4 bits of I can be copied to A in the GL to get
  618.           this to work correctly but this affects performance. Since the tlut
  619.           is only 8 bits in and not 12, we take the time to copy the I channel
  620.           to A for the IA_8 format when the user texture is one component, so
  621.           the tlut will function correctly.
  622.  
  623.           -  using TX_DETAIL, requires J,K to be 4 and the detail image to be
  624.           256x256, forcing the subimage size to be 64x64. Allowable values of
  625.           M,N are {4,4} (the default), {8,8}, {16,16}, {32,32}, or {64,64}.
  626.           Scramble has no effect.
  627.  
  628.           -  If TX_BICUBIC is used for either TX_MINFILTER, or TX_MAGFILTER it
  629.           will be used for _b_o_t_h TX_MINFILTER and TX_MAGFILTER.  This filter
  630.           must always be used with an internal format that has at least 12
  631.           bits per component.
  632.  
  633.           -  3D textures do not support TX_TILE.
  634.  
  635.  
  636.  
  637.           -  3D textures do not support TX_SELECT.
  638.  
  639.           -  If TX_MAGFILTER_COLOR and/or TX_MAGFILTER_ALPHA are used, one
  640.           filter must be TX_MIPMAP_TRILINEAR and the other must be TX_SHARPEN,
  641.           TX_MODULATE_DETAIL or TX_ADD_DETAIL.
  642.  
  643.           -  The TX_POINT filter may not produce the exact value of the
  644.           texture pixel sampled due to arithmetic approximations.
  645.  
  646.           -  The TX_BILINEAR_LEQUAL, TX_BILINEAR_GEQUAL minification and
  647.           magnification filters and TX_I_16 format texel are tied together in
  648.           the implementation so that they must be used together and in fact
  649.           cannot be used with any other minification and magnification filters
  650.           and texel formats.  Similarly, the texture environment TV_ALPHA (see
  651.           tttteeeevvvvddddeeeeffff) can be used only with TX_I_16.  This combination of features
  652.           is used for a real-time shadows effect.
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. tttteeeexxxxddddeeeeffff((((3333GGGG))))                                                          tttteeeexxxxddddeeeeffff((((3333GGGG))))
  665.  
  666.  
  667.  
  668.      On IRIS-4D VGX, and VGXT when using TTTTXXXX____TTTTIIIILLLLEEEE, _w_i_d_t_h and _h_e_i_g_h_t of both the
  669.      original image and the specified subregion must be a power of 2.
  670.  
  671.      On IRIS-4D VGX model when using TTTTXXXX____TTTTIIIILLLLEEEE, texture coordinate _t is always
  672.      clamped to the range 0.0 through 1.0 regardless of the value of
  673.      TTTTXXXX____WWWWRRRRAAAAPPPP____TTTT.
  674.  
  675.      On IRIS-4D VGX model when TTTTXXXX____WWWWRRRRAAAAPPPP____SSSS is set to TTTTXXXX____CCCCLLLLAAAAMMMMPPPP, TTTTXXXX____WWWWRRRRAAAAPPPP____TTTT also be
  676.      set to TTTTXXXX____CCCCLLLLAAAAMMMMPPPP.  Otherwise operation is undefined.
  677.  
  678.      On IRIS-4D VGXT models when using TTTTXXXX____TTTTIIIILLLLEEEE, and TTTTXXXX____WWWWRRRRAAAAPPPP____TTTT, TTTTXXXX____WWWWRRRRAAAAPPPP____SSSS, or
  679.      TTTTXXXX____WWWWRRRRAAAAPPPP are set to TTTTXXXX____CCCCLLLLAAAAMMMMPPPP, the texture coordinates in the corresponding
  680.      dimension must be within the closed range [0,1].
  681.  
  682.      On IRIS-4D RealityEngine models TTTTXXXX____TTTTIIIILLLLEEEE and TTTTXXXX____SSSSEEEELLLLEEEECCCCTTTT do not work
  683.      together.
  684.  
  685.      In the Graphics Library Programmer's Guide (1992) pg. 18-30 eq. 18-1
  686.      should read:
  687.  
  688.  
  689.           M,N = 256/(2^(2+N))
  690.  
  691.      and the TX_DETAIL example that follows should read:
  692.  
  693.  
  694.           TX_DETAIL,4.,4.,16.,16.,0,
  695.  
  696.      On Infinite Reality and Impact TTTTXXXX____TTTTIIIILLLLEEEE , TTTTXXXX____SSSSEEEELLLLEEEECCCCTTTT , TTTTXXXX____DDDDEEEETTTTAAAAIIIILLLL, and
  697.      TTTTXXXX____SSSSHHHHAAAARRRRPPPPEEEENNNN are not supported.  They do not support TTTTXXXX____MMMMAAAAGGGGFFFFIIIILLLLTTTTEEEERRRR____CCCCOOOOLLLLOOOORRRR or
  698.      TTTTXXXX____MMMMAAAAGGGGFFFFIIIILLLLTTTTEEEERRRR____AAAALLLLPPPPHHHHAAAA.  They do not support TTTTXXXX____FFFFAAAASSSSTTTT____DDDDEEEEFFFFIIIINNNNEEEE with TTTTXXXX____PPPPIIIIXXXXMMMMOOOODDDDEEEE
  699.      TTTTXXXX____BBBBIIIILLLLIIIINNNNEEEEAAAARRRR____LLLLEEEEQQQQUUUUAAAALLLL, TTTTXXXX____BBBBIIIILLLLIIIINNNNEEEEAAAARRRR____GGGGEEEEQQQQUUUUAAAALLLL, and they do not support
  700.      TTTTXXXX____BBBBIIIICCCCUUUUBBBBIIIICCCC
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.